package com.ljt.yupictureddd.application.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ljt.yupictureddd.infrastracture.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.ljt.yupictureddd.domain.picture.entity.Picture;
import com.ljt.yupictureddd.domain.user.entity.User;
import com.ljt.yupictureddd.interfaces.vo.picture.PictureVO;
import com.ljt.yupictureddd.interfaces.dto.picture.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 六件套
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-03-07 19:43:57
*/
public interface PictureApplicationService extends IService<Picture> {
    /**
     * 上传图片，
     * @param pictureUploadRequest
     * @param loginUser 当前登陆的用户
     * @return
     */
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

    /**
     * 填充审核参数
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(Picture picture, User loginUser);

    /**
     * 获得MybatisPlus查询对象
     *
     * @param request
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest request);


    /**
     * 由分页的picture对象查出分页的PictureVO对象(列表查列表)
     *
     * @param page    分页的Picture对象
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOList(Page<Picture> page, HttpServletRequest request);


    /**
     * 审核图片
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 批量抓取图片和上传图片
     *
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);
    /**
     * 删除图片
     * @param id
     * @param loginUser
     */
    void deletePicture(Long id, User loginUser);

    /**
     * 编辑图片
     * @param pictureEditRequest
     * @param loginUser
     */
    void editPicture(PictureEditRequest pictureEditRequest, User loginUser);

    /**
     * 根据颜色色调查询图片（封装类）
     */
    List<PictureVO> searchPictureByColor(Long spaceId,String picColor,User loginUser);


    /**
     * 批量修改图片
     */
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);


    /**
     * 创建扩图请求
     *
     * @return
     */
    CreateOutPaintingTaskResponse createOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
